home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / arcers / zv25.zip / ZV25.BAS < prev    next >
BASIC Source File  |  1992-09-29  |  32KB  |  1,119 lines

  1. '$INCLUDE: 'zv07.inc'   'contains archive structures and declares
  2. ' ZV      BAS : A Quick Basic archive dir viewer for MS-DOS machines
  3. ' author .....: Dick Dennison [74270,3636]  914-374-3903 3-9600 24 hrs
  4. '             : 1:272/34@fido 100:900/9@Magnet
  5. ' supports ...: ZIP, LZH, ARC, PAK, ZOO, ARJ, SQZ, sfx archive formats,
  6. '             : PKLite, Diet, LZE shrinkers
  7. ' syntax .....: ZV FILENAME [options]
  8. ' returns ....: The member filespecs in the archive
  9. ' includes ...: ZV07.INC = contains archive structures
  10. '             : EXTRNSxx.lib = external routines for linking
  11. ' notes ......: All output is thru screen now for speed
  12. '             : This used to go thru dos
  13. '             : This used to allow easy porting to comm port routines
  14. ' cost .......: Free with credit
  15. '             : Do not use for commercial use - may not be resold
  16. '             : May not be rebundled without prior written consent
  17. ' trademarks .: ZIP and PKLite are the property of Phil Katz
  18. '             : ARC is the property of SEA
  19. '             : ZOO is the property of Rahul Dhesi
  20. '             : PAK is the property of NoGate Consulting
  21. '             : Lharc and LHA are the property of Yoshi
  22. '             : ARJ is the property of Robert K. Jung
  23. '             : SQZ is the property of J I Hammarberg
  24. '             : MS-DOS is the property of MicroSoft
  25. '             : DIET is the property of Teddy Matsumoto
  26. '             : LZE is the property of Fabrice Bellard
  27. '             : etc., etc., et.al.
  28. ' dated ......: 10/24/90 - QBNews edition
  29. '             : 03/10/91 - support for LHA files added
  30. '             : 04/16/91 - guss functs, find first VERS 2.0
  31. '             : 05/10/91 - ARJ file support
  32. '             : 06/01/91 - EXE files support zip, pak, lzh, lha, arj
  33. '             : 08/07/91 - cleanup pause
  34. '             : 09/15/91 - redid ARJ code to allow for file comments
  35. '             : 01/15/92 - Put CRC into ZIP display
  36. '             : 01/16/92 - Bounce bar and wildcards
  37. '             : 02/29/92 - Fix in LZH for 0 length file
  38. '             : 06/07/92 - Cleaned display, extrns.obj added
  39. '             : 06/08/92 - Added Diet, Pklite, Lze
  40. '             : 06/21/92 - Rewrote LZH section for SFX files
  41. '             : 06/23/92 - Allowed for nonstd Arj sfx header
  42. '             : 09/27/92 - Squeeze support
  43. '             : 09/29/92 - Fixed Arj and Pak sfx bugs
  44. ' link info   : BC zv25.bas/T/C:512; and then Link with Extrns25.lib:
  45. '             : LINK
  46. '             : /EX /NOE /NOD:BCOM45.LIB ZV25
  47. '             : BRUN45.LIB+
  48. '             : QB.LIB+
  49. '             : EXTRNS25.LIB
  50. DECLARE SUB sqzvu (filestr$)
  51. DECLARE SUB getname (filestr$)
  52. DECLARE SUB center (text$)
  53. DECLARE SUB arjvu (filestr$)
  54. DECLARE SUB pakview (filestr$)
  55. DECLARE SUB zooview (filestr$)
  56. DECLARE SUB arcview (filestr$)
  57. DECLARE SUB lzhview (filestr$)
  58. DECLARE SUB showmsg (Msg$)
  59. DECLARE SUB zipview (filestr$)
  60. DECLARE SUB Update (oldate%, oldtime%, FileName$)
  61. DECLARE SUB Switches ()
  62. DECLARE FUNCTION fixtime$ (parm%)
  63. DECLARE FUNCTION fixdate$ (parm%)
  64. DECLARE FUNCTION FileStru$ (filespec$)
  65. DECLARE SUB ExitWithErrLvl ALIAS "_exit" (BYVAL ErrorLevel%)
  66. 'End declares
  67.  
  68. TYPE filestruct
  69.         res AS STRING * 20
  70.         Attr AS INTEGER
  71.         Timef AS INTEGER
  72.         Datef AS INTEGER
  73.         size AS LONG
  74.         nameff AS STRING * 14
  75. END TYPE
  76. COMMON SHARED exeflag%, count%, pause%, redate%, oldtype%, namef$, errlevel%, SpecSeek%
  77. CLEAR , , 20000  'needed some extra stack space
  78.  
  79. DIM SHARED mon(12) AS STRING
  80. mon$(1) = "-Jan-": mon$(2) = "-Feb-": mon$(3) = "-Mar-": mon$(4) = "-Apr-"
  81. mon$(5) = "-May-": mon$(6) = "-Jun-": mon$(7) = "-Jul-": mon$(8) = "-Aug-":
  82. mon$(9) = "-Sep-": mon$(10) = "-Oct-": mon$(11) = "-Nov-": mon$(12) = "-Dec-"
  83.  
  84. DIM SHARED banner1$
  85. CONST headban$ = "Filename      Length    Size  SF%  Time      Date       Method    CRC"
  86.                  '--5---10---15---20---25---30---35---40---45---50---55---60---65---70---75
  87.  
  88. banner1$ = STRING$(75, "═")
  89.  
  90. COLOR 15, 0
  91. Switches
  92. END
  93.  
  94. SUB arcview (filestr$)
  95. DIM dummy AS STRING * 20
  96. DIM arc AS header   'header is in include file
  97. OPEN filestr$ FOR BINARY AS 1 LEN = LEN(arc)
  98.  
  99. 'Display Banner
  100.  
  101. a$ = FileStru$(filestr$)
  102. b$ = "ZV Archive : " + a$
  103.  
  104. center b$
  105. showmsg banner1$
  106. showmsg headban$
  107. showmsg banner1$
  108.  
  109. leng& = LOF(1)
  110. FOR n% = 1 TO 32767   'arbitrary number
  111.     GET 1, , arc
  112.     sig% = arc.arcid AND 255   'Low order of byte is ID signature
  113.     meth% = arc.arcid \ 256    'Method of compression in high order
  114.     IF sig% <> 26 THEN
  115.         n% = n% - 1
  116.         EXIT FOR
  117.     END IF
  118.     IF meth% < 1 THEN
  119.         n% = n% - 1
  120.         EXIT FOR
  121.     END IF
  122.     IF n% = 1 THEN olddate% = arc.adate
  123.     IF olddate% <= arc.adate THEN
  124.         olddate% = arc.adate
  125.         oldtime% = arc.atime
  126.     END IF
  127.    
  128.     ntime$ = fixtime$(arc.atime)
  129.     ndate$ = fixdate$(arc.adate)
  130.     mark% = INSTR(arc.FileName, ".")
  131.     IF mark% < 2 THEN mark% = 9  'incase filename has no extension
  132.     'Parse filename and format for printing
  133.     FOR x% = 1 TO 13
  134.         IF MID$(arc.FileName, x%, 1) = CHR$(0) THEN EXIT FOR
  135.         FileName$ = FileName$ + MID$(arc.FileName, x%, 1)
  136.     NEXT x%
  137.     
  138.   SELECT CASE meth%        ' Select correct compression text
  139.     CASE IS = 1
  140.         met$ = "------    "  ' No compression used
  141.     CASE IS = 2
  142.         met$ = "Stored    "  ' Repeated running length encoding (RLE)
  143.     CASE IS = 3
  144.         met$ = "Packed    "  ' Huffman encoding
  145.     CASE IS = 4
  146.         met$ = "Squeezed  "  ' LZW with 4K buffer, 12 bits codes
  147.     CASE IS = 5
  148.         met$ = "Crunched  "  ' First packing, then LZW 4K buffer with 12 bits
  149.     CASE IS = 6
  150.         met$ = "Crunched  "  ' Packing, LZW, 4K buffer, vari len (9-12 bits)
  151.     CASE IS = 7
  152.         met$ = "Crunched  "  ' LZW, 8K buffer, variable length (9-13 bits)
  153.     CASE IS = 8
  154.         met$ = "Crunched  "
  155.     CASE IS = 9
  156.         met$ = "Squashed  "
  157.     CASE IS = 10
  158.         met$ = "Crushed   "  ' Packing, then LZW 8K buffer, 2-13 bits (PAK 1.0)
  159.     CASE IS = 11
  160.         met$ = "Distill   "  ' Dynamic Huffman with 8K buffer (PAK 2.0)
  161.     CASE ELSE
  162.         met$ = "--------  "  ' usually -1
  163.   END SELECT
  164.  
  165.   totcomp& = totcomp& + arc.NewSize  'Get the totals for the archive
  166.   totunc& = totunc& + arc.OldSize
  167.  
  168.   'Because the filesizes are different lengths we need to
  169.   'Parse the display and add spacing
  170.   C$ = SPACE$(12 - LEN(FileName$))
  171.   f$ = factor$(arc.NewSize, arc.OldSize)
  172.   D$ = Long2str$(arc.NewSize, 8)
  173.   e$ = Long2str$(arc.OldSize, 8)
  174.   
  175.  
  176.   PadCrc$ = HEX$(arc.CRC)
  177.   PadCrc$ = PadNum$(PadCrc$, 4)
  178.   g$ = FileName$ + C$ + D$ + e$ + f$ + ntime$ + ndate$ + met$ + PadCrc$
  179.   showmsg g$
  180.  
  181.   where& = SEEK(1)
  182.   IF totcomp& + n% * LEN(arc) >= leng& THEN EXIT FOR
  183.   IF LEN(header) + where& + arc.NewSize >= leng& THEN EXIT FOR 'At end yet?
  184.   SEEK 1, where& + arc.NewSize   'Position read/write head for next file get
  185. FileName$ = ""
  186. NEXT n%
  187. SEEK 1, LOF(1) - 20
  188. GET 1, , dummy$
  189. CLOSE 1
  190. IF INSTR(dummy$, "PK") THEN comp$ = "PAK3.6" ELSE comp$ = "ARC"
  191. 'Show trailer
  192. IF redate% THEN CALL Update(olddate%, oldtime%, filestr$)
  193. oldate$ = fixdate$(olddate%)
  194. oldtime$ = fixtime$(oldtime%)
  195.  
  196. showmsg banner1$
  197. g$ = Numfix$(n%) + Long2str$(totcomp&, 8) + Long2str$(totunc&, 8) + factor$(totcomp&, totunc&) + oldtime$ + oldate$ + comp$
  198. showmsg g$
  199.  
  200. END SUB
  201.  
  202. SUB arjvu (filestr$)
  203. 'EA 60  header ID
  204. OPEN filestr$ FOR BINARY AS 1
  205. IF exeflag% THEN SEEK 1, SpecSeek%
  206.  
  207. DIM head AS arjheader
  208. DIM extra AS arjextra
  209. DIM one AS STRING * 1
  210. 'Display Banner
  211. a$ = FileStru$(filestr$)
  212. b$ = "ZV Archive : " + a$
  213. center b$
  214. showmsg banner1$
  215. showmsg headban$
  216. showmsg banner1$
  217.  
  218. leng& = LOF(1)
  219.  
  220. 'This first get gets the archive name
  221. GET 1, , head
  222.     FOR p% = 0 TO 13
  223.         a$ = INPUT$(1, 1)              'Search for ASCIIZ(0)
  224.         IF a$ = "/" THEN p% = p% - 1
  225.         IF a$ = CHR$(0) THEN EXIT FOR
  226.         namefile$ = namefile$ + a$
  227.     NEXT p%
  228.     version$ = STR$(ASC(head.vers))
  229.     IF exeflag% THEN version$ = " SFX"
  230. DO
  231.     GET 1, , one           'Testing for comments
  232.     
  233.     IF one = CHR$(0) THEN EXIT DO
  234. '     PRINT #5, one;         'Prints the comments
  235.  
  236. LOOP
  237.    
  238.     SEEK 1, SEEK(1) + 6   'I don't know why??
  239.  
  240. namefile$ = ""
  241. 'This is the root of the program
  242. DO WHILE NOT EOF(1)
  243.     GET 1, , head
  244.     IF exeflag% AND NOT head.id = -5536 THEN
  245.         showmsg "Non-standard ARJ-SFX header - not supported"
  246.         CLOSE 1
  247.         EXIT SUB
  248.     END IF
  249.     IF head.HeadSz = 0 THEN EXIT DO
  250.     n% = n% + 1   'count number of files
  251.     FOR p% = 0 TO 13
  252.         a$ = INPUT$(1, 1)
  253.         IF a$ = "/" THEN
  254.             p% = p% - 4     'I don't know why???
  255.             subd$ = subd$ + namefile$ + a$
  256.             namefile$ = ""
  257.             subdir% = -1
  258.             a$ = ""
  259.         END IF
  260.         IF a$ = CHR$(0) THEN EXIT FOR    'file name is ASCIIZ
  261.         namefile$ = namefile$ + a$
  262.     NEXT p%
  263.     b$ = namefile$ + SPACE$(12 - (LEN(namefile$)))   'Centers the display
  264.  
  265.     GET 1, , extra
  266.     namefile$ = ""
  267.   
  268.     fulsize& = fulsize& + head.origsize   'for synopsis line
  269.     totarc& = totarc& + head.sizenow
  270.  
  271.     origsize$ = Long2str$(head.origsize, 8)
  272.     sizenow$ = Long2str$(head.sizenow, 8)
  273.     IF n% = 1 THEN olddate% = head.date
  274.     IF olddate% <= head.date THEN
  275.             olddate% = head.date
  276.             oldtime% = head.time
  277.     END IF
  278.  
  279.     
  280.     b$ = b$ + sizenow$ + origsize$ + factor$(head.sizenow, head.origsize) + fixtime$(head.time) + fixdate$(head.date)
  281.    
  282.     SELECT CASE ASC(head.meth)
  283.         CASE 0
  284.             meth$ = "Comp-0    "
  285.         CASE 1
  286.             meth$ = "Comp-1    "
  287.         CASE 2
  288.             meth$ = "Comp-2    "
  289.         CASE 3
  290.             meth$ = "Comp-3    "
  291.         CASE 4
  292.             meth$ = "Comp-4    "
  293.     END SELECT
  294.   
  295.     CRC$ = HEX$(head.origcrc)      'format CRC for display
  296.     CRC$ = PadNum$(CRC$, 8)
  297.     IF subdir% THEN     'show path
  298.         IF NOT C$ = subd$ THEN    'show path again if changed
  299.             showmsg subd$
  300.             C$ = subd$
  301.             subdir% = 0
  302.         END IF
  303.     END IF
  304.     subd$ = ""
  305.     b$ = b$ + meth$ + CRC$
  306.     showmsg b$
  307.     a& = SEEK(1)
  308.     a& = a& + head.sizenow - 3  'Admitted kludge
  309.     IF a& < 1 THEN EXIT DO
  310.     SEEK 1, a&
  311. LOOP
  312. CLOSE 1
  313. showmsg banner1$
  314.  
  315. IF redate% THEN CALL Update(olddate%, oldtime%, filestr$)
  316. oldate$ = fixdate$(olddate%)
  317. oldtime$ = fixtime$(oldtime%)
  318.  
  319. showmsg banner1$
  320. g$ = Numfix$(n%) + Long2str$(totarc&, 8) + Long2str$(fulsize&, 8) + factor$(totarc&, fulsize&) + oldtime$ + oldate$ + "Arj" + version$
  321. showmsg g$
  322.  
  323. END SUB
  324.  
  325. SUB center (text$)
  326.  
  327. C$ = SPACE$((80 - LEN(text$)) \ 2 - 3)      'Center line
  328. text$ = C$ + text$
  329. showmsg text$
  330. showmsg banner1$
  331.  
  332. END SUB
  333.  
  334. FUNCTION FileStru$ (filespec$)
  335. DIM regs AS RegTypeX
  336. 'File structures
  337. DIM fi AS filestruct
  338.  
  339. temp$ = filespec$ + CHR$(0)
  340.  
  341.         regs.ax = &H1A00                       'DOS service to set DTA
  342.         regs.ds = VARSEG(fi)
  343.         regs.dx = VARPTR(fi)
  344.         CALL INTERRUPTX(&H21, regs, regs)
  345.  
  346.         regs.ax = &H4E00                       'Find first matching file
  347.         regs.cx = 0                            'reg files
  348.         regs.ds = VARSEG(temp$)
  349.         regs.dx = SADD(temp$)
  350.         CALL INTERRUPTX(&H21, regs, regs)
  351.  
  352.         IF regs.flags AND 1 THEN
  353.                 a$ = filespec$ + " File not Found"
  354.                 FileStru$ = a$
  355.                
  356.                 EXIT FUNCTION
  357.         END IF
  358.  
  359. '        PRINT fixdate$(fi.datef),
  360.  '       PRINT fixtime$(fi.timef),
  361.   '      PRINT fi.size,
  362.    '     PRINT fi.nameff  'parse for AsciiZ
  363.  
  364.         a$ = fi.nameff + Long2str$(fi.size, 8) + "  " + fixtime(fi.Timef) + fixdate(fi.Datef)
  365.         FileStru$ = a$
  366.  
  367.  
  368. END FUNCTION
  369.  
  370. FUNCTION fixdate$ (parm%)
  371. 'Date and time are in packed format - these are the breakouts
  372. 'bits 00h-04h = day (1-31)
  373. 'bits 05h-08h = month (1-12)
  374. 'bits 09h-0Fh = year (relative to 1980)
  375.  
  376. day% = parm% AND 31        'get bits 0-4
  377. dayz$ = LTRIM$(STR$(day%))
  378. IF LEN(dayz$) = 1 THEN dayz$ = "0" + (dayz$)  'Parse and add leading 0 if needed
  379. parm% = parm% \ 32         'shift left 5
  380. month% = parm% AND 15      'get bits 5-8
  381. parm% = parm% \ 16         'shift left 4
  382. year% = (parm% AND 255) + 80    'get bits 9-15 and add to 1980
  383. moddate$ = dayz$ + mon$(month%) + LTRIM$(STR$(year%))  'Format is 20-Oct-90
  384.  
  385. fixdate$ = "  " + moddate$ + "  "
  386.  
  387. END FUNCTION
  388.  
  389. FUNCTION fixtime$ (parm%)
  390. 'Date and time are in packed format - these are the breakouts
  391. 'bits 00h-04h = 2 second incs (0-29)
  392. 'bits 05h-0Ah = minutes (0-59)
  393. 'bits 0Bh-0Fh = hours (0-23)
  394.  
  395. temp& = parm%
  396. IF parm% < 0 THEN temp& = temp& + 65536  'Check for sign (+ -)
  397. secs% = (temp& AND 31) * 2  'get bits 0-4 and multiply by 2
  398. temp& = temp& \ 32          'shift right 5
  399. mins% = temp& AND 63        'get bits 5-10
  400. temp& = temp& \ 64          'shift right 6
  401. hours% = temp& AND 31       'get bits 11-15
  402. sec$ = LTRIM$(STR$(secs%))
  403. IF LEN(sec$) = 1 THEN sec$ = "0" + sec$    'Parse and add leading 0's
  404. min$ = LTRIM$(STR$(mins%))
  405. IF LEN(min$) = 1 THEN min$ = "0" + min$    'if needed
  406. hour$ = LTRIM$(STR$(hours%))
  407. IF LEN(hour$) = 1 THEN hour$ = "0" + hour$
  408.  
  409. modtime$ = hour$ + ":" + min$ + ":" + sec$  'Format is 01:30:46
  410. fixtime$ = modtime$
  411.  
  412. END FUNCTION
  413.  
  414. SUB getname (filestr$)
  415.        
  416. SHARED pause%
  417. IF filestr$ = "" THEN
  418.     CLS
  419.     PRINT #5, "Filename: ";
  420.     LINE INPUT filestr$
  421. END IF
  422.  
  423. IF INSTR(filestr$, "?") THEN wild% = -1
  424. IF INSTR(filestr$, "*") THEN wild% = -1
  425.  
  426. mark% = INSTR(filestr$, ".")
  427. IF mark% = 0 THEN                 'temp is left part of filename
  428.     temp$ = filestr$
  429.     filestr$ = filestr$ + ".*"
  430. ELSE temp$ = LEFT$(filestr$, mark% - 1)
  431. END IF
  432.  
  433. markstar% = INSTR(filestr$, "*")
  434. IF markstar% THEN wild% = -1
  435. IF markstar% THEN markstar2% = INSTR(markstar% + 1, filestr$, "*")
  436. IF markstar2% THEN dwild% = -1   '*.*
  437. IF markstar% AND markstar% < mark% THEN dwild% = -1
  438. 'PRINT markstar%, mark%, markstar2%, wild%, dwild%
  439.  
  440. IF mark% AND NOT markstar% THEN ext$ = UCASE$(MID$(filestr$, mark% + 1)) 'full filename
  441. IF ext$ = "COM" THEN exeflag% = -1
  442. IF ext$ = "EXE" THEN exeflag% = -1
  443. IF INSTR("PAKARCARJZIPZOOLZH", ext$) AND NOT wild% THEN
  444.     namef$ = filestr$
  445.     GOTO gotit
  446. END IF
  447.  
  448. again:
  449. ext$ = guss$(filestr$)
  450. IF exeflag% THEN filestr$ = temp$ + ".EXE" ELSE filestr$ = temp$ + "." + ext$
  451. IF dwild% THEN filestr$ = namef$
  452. gotit:
  453. IF errlevel% GOTO again
  454.  
  455. 'pakview namef$
  456. 'END
  457.  
  458. SELECT CASE ext$
  459.     CASE "LZH"
  460.         lzhview namef$
  461.     CASE "ZIP"
  462.         zipview namef$
  463.     CASE "ARC"
  464.         arcview namef$
  465.     CASE "ZOO"
  466.         zooview namef$
  467.     CASE "PAK"
  468.         pakview namef$
  469.     CASE "ARJ"
  470.         arjvu namef$
  471.     CASE "COM"
  472.         exeflag% = -1
  473.         lzhview namef$
  474.     CASE "EXE"
  475.         exeflag% = -1
  476.         ext$ = guss$(filestr$)
  477.         GOTO again
  478.     CASE "SQZ"
  479.         sqzvu namef$
  480.     CASE "PKLITE"
  481.         showmsg filestr$ + " is compressed by PKLite"
  482.     CASE "DIET"
  483.         showmsg filestr$ + " is compressed by DIET"
  484.     CASE "LZE"
  485.         showmsg filestr$ + " is compressed by LZE"
  486.     CASE ELSE
  487.         'showmsg "Cannot view " + filestr$
  488.         CLOSE 1
  489.  '         END
  490. END SELECT
  491. IF wild% THEN
  492.     'IF ready% THEN
  493.         
  494.         showmsg banner1$
  495.         showmsg banner1$
  496.         PRINT #5, " "
  497.         IF wild% THEN filestr$ = temp$ + ".*"
  498.         IF pause% THEN
  499.             PRINT #5, "-=MORE=-[ESC] to end";
  500.             IF count% < 23 THEN
  501.                 DO
  502.                     aa$ = INKEY$
  503.                 LOOP WHILE aa$ = ""
  504.             END IF
  505.             cursor
  506.             LOCATE , 1: PRINT #5, "                        "
  507.             IF aa$ = CHR$(27) THEN END
  508.         END IF
  509.     
  510.     count% = 1
  511.     exeflag% = 0
  512.     
  513.     GOTO again
  514. END IF
  515.  
  516. END SUB
  517.  
  518. SUB lzhview (filestr$)
  519.  
  520. DIM buf AS STRING * 40
  521. DIM lz AS head1
  522. DIM lzh AS Head2
  523. DIM lzhc AS head3
  524. DIM abcd AS STRING * 3  'this is the diff from lh113b
  525. 'd% = (LEN(lz) + LEN(lzh))
  526.  
  527. OPEN filestr$ FOR BINARY AS 1 LEN = LEN(lzh)
  528.  
  529. IF exeflag% THEN
  530.     DIM m AS STRING * 80
  531.     GET 1, , m$
  532.     mark% = INSTR(m$, "LH")
  533.     comp$ = MID$(m$, mark%, 17)
  534.     IF INSTR(comp$, "LHarc") THEN oldtype% = -1
  535.     IF NOT oldtype% THEN comp$ = LEFT$(comp$, 15)
  536.     'PRINT comp$
  537.     IF RIGHT$(comp$, 1) = "L" THEN lmodel% = -1
  538.     IF NOT lmodel% THEN plac% = &H665
  539.     IF lmodel% THEN plac% = &H795
  540.     IF oldtype% AND lmodel% THEN plac% = &H750
  541.     IF oldtype% AND NOT lmodel% THEN plac% = &H4F1
  542.     SEEK 1, plac%
  543.     GET 1, , buf$
  544.     'PRINT buf$
  545.     mark% = INSTR(buf$, "-lh")
  546.     SEEK 1, plac% + (mark% - 3)
  547. END IF
  548.  
  549. a$ = FileStru$(filestr$)
  550. b$ = "ZV Archive : " + a$
  551. center b$
  552. showmsg banner1$
  553. showmsg headban$
  554. showmsg banner1$
  555. FOR n% = 1 TO 32767   'arbitrary number
  556.     GET 1, , lz     'From include file
  557.     GET 1, , lzh    'Filename length is variable
  558.  
  559.     IF n% = 1 THEN olddate% = lzh.dat  'save newest date:time
  560.     IF olddate% <= lzh.dat THEN
  561.         olddate% = lzh.dat
  562.         oldtime% = lzh.tim
  563.     END IF
  564.  
  565.     ti$ = fixtime$(lzh.tim)   'Unpack date and time
  566.     da$ = fixdate$(lzh.dat)
  567.     fl% = ASC(lzh.fnl)        'This is the filename length
  568.     IF fl% = 0 THEN EXIT FOR  'If len is 0 then exit
  569.     LzhName$ = INPUT$(fl%, 1) 'Get the number of chars in filename length
  570.     GET 1, , lzhc             'get the CRC value
  571.         'this is the difference from LHArc/LHA
  572.     IF INSTR("-lh4-lh5-", lzh.mtd) AND NOT exeflag% THEN GET 1, , abcd$
  573.     PadCrc$ = HEX$(lzhc.CRC)
  574.     PadCrc$ = PadNum$(PadCrc$, 4)
  575.     TotSize& = TotSize& + lzh.nsz
  576.     OldSize& = OldSize& + lzh.osz                'retain the file sizes
  577.  
  578.     'Format the display with spaces
  579.     C$ = SPACE$(12 - LEN(LzhName$))
  580.     D$ = Long2str$(lzh.nsz, 8)
  581.     e$ = Long2str$(lzh.osz, 8)
  582.     b$ = LzhName$ + C$ + D$ + e$ + factor$(lzh.nsz, lzh.osz) + ti$ + da$ + lzh.mtd + "     " + PadCrc$
  583.     showmsg b$
  584.     
  585.      'PRINT lzh.mtd
  586.     place& = SEEK(1) + lzh.nsz           'Move file pointer for next file
  587.     SEEK 1, place& '- 3
  588.     IF place& >= LOF(1) THEN EXIT FOR    'At end yet?
  589. NEXT n%
  590. CLOSE 1
  591. 'Format and print trailer
  592. IF lzh.mtd = "-lh1-" THEN oldtype% = -1
  593. IF NOT exeflag% AND oldtype% THEN comp$ = "LHarc.113"
  594. IF NOT oldtype% AND NOT exeflag% THEN comp$ = "LHA.2+"
  595. IF redate% THEN CALL Update(olddate%, oldtime%, filestr$)
  596. oldate$ = fixdate$(olddate%)
  597. oldtime$ = fixtime$(oldtime%)
  598.  
  599. showmsg banner1$
  600. g$ = Numfix$(n%) + Long2str$(TotSize&, 8) + Long2str$(OldSize&, 8) + factor$(TotSize&, OldSize&) + oldtime$ + oldate$ + comp$
  601. showmsg g$
  602.  
  603. END SUB
  604.  
  605. SUB pakview (filestr$)
  606. DIM pak AS paktype
  607. '2199h
  608. OPEN filestr$ FOR BINARY AS 1
  609. IF exeflag% THEN SEEK 1, &H219A   'Where did this come from ???
  610. 'Format and display banner
  611. a$ = FileStru$(filestr$)
  612. b$ = "ZV Archive : " + a$
  613.  
  614. center b$
  615. showmsg banner1$
  616. showmsg headban$
  617. showmsg banner1$
  618.  
  619. IF exeflag% THEN SEEK 1, SpecSeek% '&H219A '1AD4
  620.  
  621. FOR n% = 1 TO 32767    'largest integer
  622.     
  623.     GET 1, , pak
  624.  
  625.     SELECT CASE ASC(pak.version)
  626.         CASE 0 '  End of file.  File header is only 2 bytes long (26 and 0).
  627.             meth$ = "---------"
  628.             EXIT FOR
  629.         CASE 1 ' No compression. File header lacks the Length field.
  630.             meth$ = "--------- "
  631.         CASE 2 ' No compression.
  632.             meth$ = "None      "
  633.         CASE 3 ' Run-length encoding (RLE).
  634.             meth$ = "RLE       "
  635.         CASE 4 ' Huffman squeezing.
  636.             meth$ = "Huffman   "
  637.         CASE 5 ' Fixed-length 12 bit LZW compression.
  638.             meth$ = "12bit LZW "
  639.         CASE 6 ' As above, with RLE.
  640.             meth$ = "LZW w RLE "
  641.         CASE 7 ' As above, but with a different hashing scheme.
  642.             meth$ = "LZW w RLE "
  643.         CASE 8 ' Variable-length 9-12 bit LZW compression with RLE.
  644.             meth$ = "LZW w RLE "
  645.         CASE 9 ' Variable-length 9-13 bit LZW compression without RLE.
  646.             meth$ = "LZW n RLE "
  647.         CASE 10' Crushing
  648.             meth$ = "Crushing  "
  649.         CASE 11
  650.             meth$ = "Distilled "
  651.         CASE ELSE
  652.             meth$ = "Unknown   "
  653.     END SELECT
  654.    
  655.     IF n% = 1 THEN olddate% = pak.date
  656.     IF olddate% <= pak.date THEN
  657.        olddate% = pak.date
  658.        oldtime% = pak.time
  659.     END IF
  660.     
  661.     IF ASC(pak.version) < 7 THEN comp$ = "ARC/ARCA"
  662.     IF ASC(pak.version) = 7 THEN comp$ = "PAK 1.0 "
  663.     IF ASC(pak.version) > 8 THEN comp$ = "PAK 2.0 "
  664.    
  665.     mark% = INSTR(pak.FileName, CHR$(0))
  666.     FileName$ = LEFT$(pak.FileName, mark% - 1)
  667.     C$ = SPACE$(12 - LEN(FileName$))
  668.     pdate$ = fixdate$(pak.date)
  669.     ptime$ = fixtime$(pak.time)
  670.    
  671.     i$ = Long2str$(pak.length, 8)
  672.     j$ = Long2str$(pak.size, 8)
  673.     PadCrc$ = HEX$(pak.CRC)
  674.     PadCrc$ = PadNum$(PadCrc$, 4)
  675.     b$ = FileName$ + C$ + i$ + j$ + factor$(pak.length, pak.size) + ptime$ + pdate$ + meth$ + PadCrc$
  676.     showmsg b$
  677.     size& = size& + pak.length
  678.     nsize& = nsize& + pak.size
  679.     place& = SEEK(1) + pak.size
  680.     IF place& >= LOF(1) - ((n%) * 30) THEN EXIT FOR  'allow for extended
  681.     SEEK 1, place&                                   'pak info before EOF
  682.  
  683. NEXT n%
  684. CLOSE 1
  685. IF redate% THEN CALL Update(olddate%, oldtime%, filestr$)
  686. oldtime$ = fixtime$(oldtime%)
  687. oldate$ = fixdate$(olddate%)
  688. 'Format trailer
  689. showmsg banner1$
  690. g$ = Numfix$(n%) + Long2str$(size&, 8) + Long2str$(nsize&, 8) + factor$(size&, nsize&) + oldtime$ + oldate$ + comp$
  691. showmsg g$
  692.  
  693.  
  694. END SUB
  695.  
  696. SUB showmsg (Msg$)
  697. SHARED cr$
  698. count% = count% + 1
  699. PRINT #5, Msg$ + cr$
  700. IF count% MOD 23 = 0 THEN
  701.     
  702.     IF pause% THEN
  703.         PRINT #5, "-=MORE=-[ESC] to end";
  704.         DO
  705.             aa$ = INKEY$
  706.         LOOP WHILE aa$ = ""
  707.         cursor
  708.         x% = CSRLIN
  709.         IF x% > 1 THEN LOCATE x% - 1, 1
  710.         IF aa$ = CHR$(27) THEN END
  711.     END IF
  712. END IF
  713.  
  714. END SUB
  715.  
  716. SUB sqzvu (filestr$)
  717. DIM dummy AS STRING * 1
  718. DIM extraword AS INTEGER
  719. DIM sqh AS Sqheader
  720. DIM sq AS Sqfheader
  721. 'if exeflag% then compressed with PKLite
  722. 'Display Banner
  723. a$ = FileStru$(filestr$)
  724. b$ = "ZV Archive : " + a$
  725. center b$
  726. showmsg banner1$
  727. showmsg headban$
  728. showmsg banner1$
  729.  
  730.  
  731. 'TYPE Sqheader
  732. '   sig AS STRING * 5
  733. '   vers as string * 1
  734. '   os AS STRING * 1
  735. '   flag AS STRING * 1
  736. 'END TYPE
  737. 'TYPE Sqfheader
  738. '    HeadSz AS STRING * 1
  739. '    Alg AS STRING * 1
  740. '    flag AS STRING * 1
  741. '    NewSize AS LONG
  742. '    OldSize AS LONG
  743. '    DateTime AS LONG
  744. '    Attr AS STRING * 1
  745. '    CRC AS LONG
  746. 'END TYPE
  747. OPEN filestr$ FOR BINARY AS 1
  748. GET 1, , sqh
  749. comp$ = "Sqeeze V." + sqh.vers
  750.  
  751. FOR n% = 1 TO 4096   'Max # of file members
  752.     GET 1, , sq
  753.     length% = ASC(sq.HeadSz) - 20
  754.     IF length% < 0 THEN EXIT FOR
  755.     FOR x% = 1 TO length%
  756.         GET 1, , dummy$
  757.         FileName$ = FileName$ + dummy$
  758.     NEXT x%
  759.     GET 1, , extraword%
  760.     IF n% = 1 THEN olddate% = sq.Datef
  761.     IF olddate% <= sq.Datef THEN
  762.       olddate% = sq.Datef
  763.       oldtime% = sq.Timef
  764.     END IF
  765.     method$ = STR$(ASC(sq.flag)) + "        "
  766.     modtime$ = fixtime$(sq.Timef)
  767.     moddate$ = fixdate$(sq.Datef)
  768.     CRC$ = HEX$(sq.CRC)
  769.     h$ = SPACE$(12 - LEN(FileName$))
  770.     i$ = Long2str$(sq.NewSize, 8)
  771.     j$ = Long2str$(sq.OldSize, 8)
  772.     k$ = factor$(sq.NewSize, sq.OldSize)
  773.     g$ = FileName$ + h$ + i$ + j$ + k$ + modtime$ + moddate$ + method$ + CRC$
  774.     showmsg g$
  775.     'PRINT extraword%
  776.     total& = total& + sq.OldSize
  777.     tot& = tot& + sq.NewSize
  778.  
  779.     FileName$ = ""
  780.     place& = SEEK(1)
  781.     SEEK 1, place& + sq.NewSize
  782. NEXT n%
  783. CLOSE 1
  784. 'File header:
  785. '    offset  Size        Comment
  786. '    0       1           Header size and type
  787. '                        0       ->  End of archive
  788. '                        1       ->  Comment
  789. '                        2       ->  Password
  790. '                        3       ->  Security envelope
  791. '                        4..18   ->  future use
  792. '                        19..    ->  normal file header
  793. '                        if normal file
  794. '    1       1           Header algebraic sum  & 0FFh
  795. '    0       1:76543210
  796. '              xxxxXXXX  Method 0..4(15)
  797. '              xxx1xxxx  Security envelope should follow
  798. '              XXXxxxxx  Future use
  799. '    1       4           Compressed size
  800. '    5       4           Original size
  801. '    9       4           Last DateTime
  802. '    13      1           Attributes
  803. '    14      4           CRC
  804. '    18..    (size-18)   filename, w/o \0.
  805. '
  806. '
  807. 'If  End of archive, done
  808. 'If  > 18 normal file
  809. '    Read HeaderSum(1 byte)
  810. '    Read size bytes
  811. '    Calculate headersum
  812. '        {short i; unsigned short s = 0U;
  813. '        for(i = 0; i < size; i++)
  814. '            s += header[i];
  815. '        if(headersum != (unsigned char)s) WRONG HEADERSUM
  816. '    header[size] = '\0';    // just to makes things easier to handle, ie.
  817. '                            // zero terminate filename
  818. '    <= 18
  819. '    Next word gives number of bytes which are used, excluding this word
  820. '    COMMENT:
  821. '        0   2           Number of bytes in comment
  822. '                        Uncompressed size = this field - 7
  823. '        2   2           Number of bytes compressed
  824. '        4   1:76543210
  825. '              xxxxXXXX  Method 0..4(15)
  826. '              xxx1xxxx  Security envelope should follow
  827. '              XXXxxxxx  Future use
  828. '        5   4           CRC
  829. '        9   size-9      Comment
  830. '    PASSWORD:
  831. '        0   2           4
  832. '        2   4           CRC for password
  833. '
  834. '            **************************************************************
  835. '            I'm not done thinking about this one yet, so I'll be in touch.
  836. '            **************************************************************
  837. '    SECURITY ENVELOPE:
  838. '        0   2           n
  839. '        n   1           None of your buisness (to be honest, I'm not done yet)
  840. '    OTHERWISE:
  841. '        0   2           Number of bytes to skip
  842. '
  843. oldate$ = fixdate$(olddate%)
  844. oldtime$ = fixtime$(oldtime%)
  845. showmsg banner1$
  846. g$ = Numfix$(n% - 1) + Long2str$(tot&, 8) + Long2str$(total&, 8) + factor$(tot&, total&) + oldtime$ + oldate$ + comp$
  847. showmsg g$
  848.  
  849.  
  850. END SUB
  851.  
  852. SUB Switches  'parse the command line
  853.               'can have:
  854.               '                   -N (nopause), x
  855.               '                   -O (outfile redirection),
  856.               '                   -D (redate),
  857.               '                   -E (errorlevel),
  858.               '                   filename$.
  859. SHARED redate%, cr$
  860. IF online% THEN cr$ = CHR$(13) + CHR$(10)   'for bbs use
  861. pause% = -1
  862. CmdLine$ = COMMAND$
  863. IF INSTR(CmdLine$, "-E") THEN
  864.     errlevel% = -1
  865.     cmd$ = CmdLine$
  866. END IF
  867. IF INSTR(CmdLine$, "-O") THEN
  868.     pause% = 0
  869.     cmd$ = CmdLine$
  870. top:
  871.     mark% = INSTR(cmd$, "-")
  872.     IF MID$(cmd$, mark% + 1, 1) = "O" THEN
  873.         FOR x% = 2 TO 13
  874.             IF MID$(cmd$, x% + mark%, 1) = " " THEN EXIT FOR
  875.             FileName$ = FileName$ + MID$(cmd$, x% + mark%, 1)
  876.         NEXT x%
  877.     ELSE
  878.         cmd$ = MID$(cmd$, mark% + 1)
  879.         GOTO top
  880.     END IF
  881.  
  882.     OPEN FileName$ FOR APPEND AS 5
  883.     a$ = CHR$(10) + DATE$ + " " + TIME$ + " Dix Archive Directory Viewer V.23 "
  884.     center a$
  885. ELSE
  886.     'OPEN "cons:" FOR OUTPUT AS 5   'See showmsg for info on this
  887.     OPEN "scrn:" FOR OUTPUT AS 5   'See showmsg for info on this
  888. END IF
  889.  
  890. showmsg CHR$(10) + CHR$(13)
  891.  
  892. IF CmdLine$ = "?" THEN
  893.     showmsg "ZV filename [options: -N -D -Ofilename]"
  894.     showmsg "ARC,ARJ,LZH,PAK,ZIP,ZOO,PKLite,Diet,LZE or sfx files"
  895.     showmsg "ZV - archive directory list - Dick Dennison C.1990,1992."
  896.     showmsg ""
  897.     showmsg "Options : "
  898.     showmsg "-N (nopause)"
  899.     showmsg "-Ofilename (outputfile redirection - implies -N)"
  900.     showmsg "-D (redate)"
  901.     showmsg "-E (exit with errorlevel as to flavor of archive : "
  902.     showmsg "   1 = ARC"
  903.     showmsg "   2 = ARJ"
  904.     showmsg "   3 = LZH"     'Must compile as standalone to
  905.     showmsg "   4 = PAK"     'exit with errorlevel with QB45
  906.     showmsg "   5 = ZIP"
  907.     showmsg "   6 = ZOO"
  908.     showmsg "   7 = PKLite"
  909.     showmsg "   8 = DIET"
  910.     showmsg "   9 = LZE"
  911.     END
  912. END IF
  913.  
  914. IF INSTR(CmdLine$, "-N") THEN pause% = 0
  915. IF INSTR(CmdLine$, "-D") THEN redate% = -1
  916. mark% = INSTR(CmdLine$, " ")
  917.  
  918. IF mark% THEN
  919.     cmd$ = LEFT$(CmdLine$, mark% - 1)
  920. ELSE
  921.     cmd$ = CmdLine$
  922. END IF
  923.  
  924. IF cmd$ = "" THEN cmd$ = getdir$
  925. getname cmd$
  926. END SUB
  927.  
  928. SUB zipview (filestr$)
  929. DIM cent AS central
  930.  
  931. 'PRINT filestr$
  932. 'dirsig$ = "02014B50"  'directory signature - don't really need this
  933. enddirsig$ = "6054B50"  'end of directory sig
  934.  
  935. DIM buf AS buftype
  936. DIM first AS dirrec
  937. OPEN filestr$ FOR BINARY AS 1 LEN = LEN(cent)
  938. a$ = FileStru$(filestr$)
  939. b$ = "ZV Archive : " + a$
  940.  
  941. center b$
  942. showmsg banner1$
  943. showmsg headban$
  944. showmsg banner1$
  945.                
  946. place& = LOF(1) - LEN(buf)
  947. IF place& < 1 THEN place& = 1   'make sure place& is > 0
  948. SEEK 1, place&    'Move file pointer near end of file and search for signature
  949.  
  950. FOR Z& = 1 TO LOF(1)
  951.     IF place& - Z& < 1 THEN   'searching backwards
  952.         showmsg "ZIP signature not found"
  953.         END
  954.     END IF
  955.     SEEK 1, place& - Z&
  956.     GET 1, , buf
  957.     IF enddirsig$ = HEX$(buf.lin) THEN       'search for zip signature
  958.         hit% = -1
  959.         place& = SEEK(1)
  960.         place& = place& - LEN(buf)  'reposition pointer to beginning of signature
  961.         SEEK 1, place&
  962.         EXIT FOR
  963.     END IF
  964. NEXT Z&
  965.  
  966. GET #1, , first             'get zip record
  967. SEEK 1, first.offset + 1    'point to first record
  968.  
  969. FOR n% = 1 TO first.num     'first.num is # of files in archive
  970.    
  971.     IF cent.extralen THEN SEEK 1, SEEK(1) + cent.extralen
  972.     IF cent.commentlen THEN SEEK 1, SEEK(1) + cent.commentlen
  973.    
  974.     GET #1, , cent          'get central directory record
  975.  
  976.     IF HEX$(cent.sig) = "6054B50" THEN EXIT FOR   'at end yet?
  977.    
  978.     FileName$ = INPUT$(cent.namelen, 1)
  979.     'subdirectory pathname?
  980.     mark% = linstr%(FileName$, "/")
  981.     IF mark% THEN
  982.         subd$ = LEFT$(FileName$, mark%)
  983.         showmsg subd$
  984.         FileName$ = MID$(FileName$, mark% + 1)
  985.         mark% = 0
  986.     END IF
  987.     
  988.     SELECT CASE cent.compmeth   'Set text for compression method
  989.         CASE IS = 0
  990.             method$ = "Stored    "
  991.         CASE IS = 1
  992.             method$ = "Shrunk    "
  993.         CASE IS = 2
  994.             method$ = "Reduced(1)"
  995.         CASE IS = 3
  996.             method$ = "Reduced(2)"
  997.         CASE IS = 4
  998.             method$ = "Reduced(3)"
  999.         CASE IS = 5
  1000.             method$ = "Reduced(4)"
  1001.         CASE IS = 6
  1002.             method$ = "Imploded  "
  1003.         CASE IS = 7
  1004.             method$ = "Tokenized "
  1005.         CASE IS = 9
  1006.             method$ = "Deflated  "
  1007.         CASE ELSE
  1008.             method$ = "Unknown   "
  1009.  
  1010.     END SELECT
  1011.     IF method$ = "Imploded  " THEN
  1012.         xz% = cent.bitflag AND 6
  1013.         IF xz% = 4 THEN method$ = "Implode-8 "
  1014.         IF xz% = 0 THEN method$ = "Implode-4 "
  1015.         IF xz% = 6 THEN method$ = "Implode-8 "
  1016.     END IF
  1017.   IF n% = 1 THEN
  1018.       temp$ = STR$(cent.vers \ 10)
  1019.       comp$ = "PKZ" + temp$ + "." + LTRIM$(STR$(cent.vers MOD 10))
  1020.   END IF
  1021.  
  1022.   CRC$ = HEX$(cent.CRC)
  1023.   IF LEN(CRC$) < 8 THEN CRC$ = STRING$(8 - LEN(CRC$), "0") + CRC$
  1024.   
  1025.  
  1026.   IF n% = 1 THEN olddate% = cent.moddate
  1027.   IF olddate% <= cent.moddate THEN
  1028.     olddate% = cent.moddate
  1029.     oldtime% = cent.modtime
  1030.   END IF
  1031.  
  1032.   'Unpack date and time
  1033.   moddate$ = fixdate$(cent.moddate)
  1034.   modtime$ = fixtime$(cent.modtime)
  1035.  
  1036.   'Format output with spaces
  1037.   h$ = SPACE$(12 - LEN(FileName$))
  1038.   i$ = Long2str$(cent.compsize, 8)
  1039.   j$ = Long2str$(cent.uncompsize, 8)
  1040.   k$ = factor$(cent.compsize, cent.uncompsize)
  1041.   g$ = FileName$ + h$ + i$ + j$ + k$ + modtime$ + moddate$ + method$ + CRC$
  1042.   showmsg g$
  1043.  
  1044.   total& = total& + cent.uncompsize      'retain size totals
  1045.   tot& = tot& + cent.compsize
  1046. NEXT n%
  1047. CLOSE 1
  1048. IF redate% THEN CALL Update(olddate%, oldtime%, filestr$)
  1049. oldate$ = fixdate$(olddate%)
  1050. oldtime$ = fixtime$(oldtime%)
  1051.  
  1052. showmsg banner1$
  1053.  
  1054. g$ = Numfix$(n% - 1) + Long2str$(tot&, 8) + Long2str$(total&, 8) + factor$(tot&, total&) + oldtime$ + oldate$ + comp$
  1055. showmsg g$
  1056.  
  1057. END SUB
  1058.  
  1059. SUB zooview (filestr$)
  1060. DIM head AS zoomaster
  1061. DIM zoo AS zoofile
  1062. OPEN filestr$ FOR BINARY AS 1
  1063.  
  1064. 'Display banner
  1065. a$ = FileStru$(filestr$)
  1066. b$ = "ZV Archive : " + a$
  1067.  
  1068. center b$
  1069. showmsg banner1$
  1070. showmsg headban$
  1071. showmsg banner1$
  1072.  
  1073. GET 1, , head    'Get central header and position file pointer to first file
  1074. comp$ = LEFT$(head.zoohead, 8)
  1075. FOR n% = 1 TO 32767  'arbitrary number
  1076.    
  1077.     GET 1, , zoo
  1078.     IF n% = 1 THEN olddate% = zoo.zoofdat
  1079.     IF olddate% <= zoo.zoofdat THEN
  1080.        olddate% = zoo.zoofdat
  1081.        oldtime% = zoo.zooftim
  1082.     END IF
  1083.    
  1084.     ztime$ = fixtime$(zoo.zooftim)     'Unpack date and time
  1085.     zdate$ = fixdate$(zoo.zoofdat)
  1086.     IF zoo.zoofnxh = 0 OR zoo.zoofnxh > LOF(1) THEN EXIT FOR
  1087.     IF ASC(zoo.zoofcmp) = 1 THEN       'Set text for compression method
  1088.         meth$ = "-LZW-     "
  1089.     ELSE meth$ = "-----     "
  1090.     END IF
  1091.     OldSize& = OldSize& + zoo.zoofosz  'save sizes
  1092.     Newer& = Newer& + zoo.zoofnsz
  1093.     'Format output with spaces
  1094.     'Parse filename and format for printing
  1095.     FOR x% = 1 TO 13
  1096.         IF MID$(zoo.zoofnam, x%, 1) = CHR$(0) THEN EXIT FOR
  1097.         FileName$ = FileName$ + MID$(zoo.zoofnam, x%, 1)
  1098.     NEXT x%
  1099.    
  1100.     '===
  1101.     C$ = Long2str$(zoo.zoofosz, 8)
  1102.     D$ = Long2str$(zoo.zoofnsz, 8)
  1103.    
  1104.     b$ = FileName$ + C$ + D$ + factor$(zoo.zoofosz, zoo.zoofnsz) + ztime$ + zdate$ + meth$ + HEX$(zoo.zoofcrc)
  1105.          'ucase$(zoo.zoofnam)
  1106.     showmsg b$
  1107.     SEEK 1, zoo.zoofnxh - 3     'Move file pointer to next file Note:don't know what the '3' is for
  1108.     
  1109. NEXT n%
  1110. CLOSE 1
  1111.  
  1112. IF redate% THEN CALL Update(olddate%, oldtime%, filestr$)
  1113. 'Print trailer
  1114. showmsg banner1$
  1115. g$ = Numfix$(n% - 1) + Long2str$(OldSize&, 8) + Long2str$(Newer&, 8) + factor$(OldSize&, Newer&) + fixtime$(oldtime%) + fixdate$(olddate%) + comp$
  1116. showmsg g$
  1117. END SUB
  1118.  
  1119.